package day14.tarena.com;

public class MyGen<G> {
	private G g;

	public G getG() {
		return g;
	}

	public void setG(G g) {
		this.g = g;
	}
	public static void main(String args[]){
		MyGen m =new MyGen();
		Object s = m.getG();		//G == Object;意思是说G是默认的Object类型。  
		
		MyGen<String> m1 = new MyGen<String>();
		String s1 = m1.getG();
		MyGen<Integer> m2 = new MyGen<Integer>();
		Integer i = m2.getG();
	}  
}
